#ifndef NOTIFY_NOTIFICATION_H
#define NOTIFY_NOTIFICATION_H

#include <QObject>


class QTimer;

namespace Notify {

class Notification : public QObject
{
    Q_OBJECT
public:
    enum NotificationType {
        MessageNotificationType,
        OnlineStatusNotificationType
    };

public:
    explicit Notification(QObject *parent = 0);
    virtual ~Notification();

private:
    QTimer *m_defaultCallbackTimer;
    int m_referenceCount;
    bool m_closing;
    int m_defaulTimeout;

signals:
    void timeout();
    void closed(const Notification *notification);

public:
    virtual NotificationType notificationType() const = 0;
    
public:
    void acquire();
    void release();
    void close();
    void setDefaultCallback();
    void setDefaultTimeout(int timeout);

public slots:
    void onTimeOut();
};

} // namespace Notify

#endif // NOTIFY_NOTIFICATION_H
